-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib: fix coverage reporting #20035
lib: fix coverage reporting #20035
Conversation
Taking the source code of a function and running it in another context does not play well with coverage instrumentation. For now, do the simple thing and just write the source code as a string literal. Fixes: nodejs#19912 Refs: nodejs#19524
CI failure looks related, e.g., https://ci.nodejs.org/job/node-test-commit-osx/nodes=osx1010/17833/consoleFull
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fails CI. Feel free to dismiss my review if I'm not around when this is addressed.
lib/internal/util.js
Outdated
@@ -390,17 +390,16 @@ function isInsideNodeModules() { | |||
// Use `runInNewContext()` to get something tamper-proof and | |||
// side-effect-free. Since this is currently only used for a deprecated API, | |||
// the perf implications should be okay. | |||
getStructuredStack = runInNewContext('(' + function() { | |||
getStructuredStack = runInNewContext(`function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems a leading (
has been accidentally removed.
The next coverage will start in ~10 hours at 0300 UTC |
Landed in 85e1819 |
Taking the source code of a function and running it in another context does not play well with coverage instrumentation. For now, do the simple thing and just write the source code as a string literal. Fixes: #19912 Refs: #19524 PR-URL: #20035 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Taking the source code of a function and running it in another context does not play well with coverage instrumentation. For now, do the simple thing and just write the source code as a string literal. Fixes: #19912 Refs: #19524 PR-URL: #20035 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Taking the source code of a function and running it in another
context does not play well with coverage instrumentation.
For now, do the simple thing and just write the source code as
a string literal.
Fixes: #19912
Refs: #19524
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes